package vfs.client.command;

import vfs.client.rmi.ClientRmiManager;
import vfs.common.command.AbstractCommand;
import vfs.common.command.Command;
import vfs.common.command.remote.RemoteCommand;

import java.rmi.RemoteException;

/**
 * User: serge
 * Date: 25.11.13
 * Time: 3:49
 */
public class RemoteWrapperCommand extends AbstractCommand implements Command
{
    RemoteCommand remoteCommand;

    public RemoteWrapperCommand(RemoteCommand remoteCommand)
    {
        this.remoteCommand = remoteCommand;
    }

    @Override
    public void execute()
    {
        try
        {
            ClientRmiManager.getInstance().getRmiDispatcher().executeCommand(remoteCommand);
        }
        catch (RemoteException e)
        {
            e.printStackTrace();  //Todo generated catch
        }
    }
}
